{template '_header'}
<script>document.title = "砍价商品详情"; </script>
    <link rel="stylesheet" type="text/css" href="../addons/ewei_shopv2/plugin/bargain/static/css/iconfont.css">
    <link rel="stylesheet" type="text/css" href="../addons/ewei_shopv2/plugin/bargain/static/css/style.css">
    <link rel="stylesheet" type="text/css" href="../addons/ewei_shopv2/plugin/bargain/static/css/bargain.css">
    <script language="javascript" type="text/javascript">
        var interval = 1000;
        function ShowCountDown(year,month,day,hour,minute,second,status,divname)
        {
            var now = new Date();
            var endDate = new Date(year, month-1, day,hour,minute,second);
            var leftTime=endDate.getTime()-now.getTime();
            var leftsecond = parseInt(leftTime/1000);
            //var day1=parseInt(leftsecond/(24*60*60*6));
            var day1=Math.floor(leftsecond/(60*60*24));
            var hour=Math.floor((leftsecond-day1*24*60*60)/3600);
            var minute=Math.floor((leftsecond-day1*24*60*60-hour*3600)/60);
            var second=Math.floor(leftsecond-day1*24*60*60-hour*3600-minute*60);
            var cc = document.getElementById(divname);
            if (status == 0) {
                cc.innerHTML = "未开始";
                return;
            }else if(status == 1){
                cc.innerHTML = "已结束";
                return;
            }else{
                cc.innerHTML = "剩余:"+day1+"天"+hour+"小时"+minute+"分"+second+"秒";
            }
        }
        window.setInterval(function(){ShowCountDown({$year},{$month},{$day},{$hour},{$minute},{$second},{$status},'divdown2');}, interval);
    </script>


<div class='fui-page-group'>
    <div class='fui-page fui-page-current'>
        {if is_h5app()}
        <div class="fui-header">
            <div class="fui-header-left">
                <a class="back"></a>
            </div>
            <div class="title">砍价商品详情</div>
            <div class="fui-header-right"></div>
        </div>
        {/if}
        <div class='fui-content'>
            <div class='fui-swipe' data-speed='5000' data-gap ='2'>
                <div class='fui-swipe-wrapper'>
                    {if $ewei_detail['thumb']}<div class="fui-swipe-item"><img src="{php echo tomedia($ewei_detail['thumb']);}" alt=""></div>{/if}
                    {loop $res['images'] $key}
                    <div class="fui-swipe-item"><img src="{php echo tomedia($key);}" alt=""></div>
                    {/loop}
                </div>
                <div class="swipe-info" style="color: {$res['custom']['countdown_color']};">
                    <font style="font-size: 20px;float: left;">{$res['custom']['countdown']}</font> <font id="divdown2" style="float: right"></font>
                </div>

            </div>
            <div class="lynn_goods_head">
                <div class="lynn-goods-head-top fui-list">
                    {if $res['type']==1}
                    <div class="fui-list-inner">
                        底价：&yen;<strong>{$res['end_price']}</strong> 原价：<del>{$res['start_price']}</del>
                    </div>
                    {/if}
                    {if $res['type']==0}
                    <div class="fui-list-inner">
                        原价：&yen; <strong>{$res['start_price']}</strong><span style="color:{$res['custom']['cutmore_color']}">{$res['custom']['cutmore']}</span>
                    </div>
                    {/if}
                    <div class="fui-list-media">
                        <i>{$res['act_times']}人参与</i>
                    </div>
                </div>
                <div class="lynn-goods-head-title fui-list">
                    <div class="fui-list-inner">
                        <h2>{$res['title']}</h2>
                        <p>{$res['title2']}</p>
                    </div>

                    <div class="fui-list-media">
                        <a href="{php echo mobileUrl('bargain/rule',array('id'=>$id))}" data-nocache="true"><i class="icon icon-menu"></i><p>规则</p></a>
                    </div>
                </div>

                <div class="lynn-goods-head-user">
                    <div class="lynn-goods-head-user-top fui-list">
                </div>
                    <div class="detail-rule">
                        <div class="detail-tule-top fui-list">
                            <div class="fui-list-inner"><i></i>砍价流程</div>

                        </div>
                        <div class="detail-tule-bot fui-list">
                            <div class="fui-list-inner active"><i>1</i><p><span>选择心仪商品</span></p></div>
                            <div class="fui-list-media"><i class="icon icon-right"></i></div>
                            <div class="fui-list-inner"><i>2</i><p><span>邀请好友砍价</span></p></div>
                            <div class="fui-list-media"><i class="icon icon-right"></i></div>
                            <div class="fui-list-inner"><i>3</i><p><span>砍到最低价后支付</span></p></div>
                        </div>
                    </div>


                <div class="detail-info content content-images">

                    <div class="detail-info-title"><span>图文详情</span></div>

                    <div class="detail-info-content">
                        {php echo htmlspecialchars_decode($res['content']);}

                    </div>
                    {template '_copyright'}
                </div>

            </div>

            <div style="height:2.5rem;"></div>

        </div>



    </div>
        <div class="fui-navbar footer-nav bordert" style="z-index:10;padding:0;">
            <a href="{php echo mobileurl(bargain);}" class="nav-item home-btn" data-nocache="true">
                <span class="icon icon-home1"></span>
                <span class="label">首页</span>
            </a>
            <a href="{php echo mobileUrl('order/create',array('id'=>$res['goods_id']));}" class="nav-item lynn-bargain-a lynn-bargain-now-a" data-nocache="true"><span>原价购买</span></a>
            {if $swi==0}
            <a {if !$act_swi['id']}href="{php echo mobileurl('bargain/join',array('goods'=>$res['id']));}"{else}onclick="FoxUI.confirm('您已经发起过一次本商品的砍价活动,是否立即查看？','砍价提示',callback)"{/if} class="nav-item lynn-bargain-a lynn-bargain-share-a"><span style="border: 1px solid {$res['custom']['btn_color']};background-color: {$res['custom']['btn_color']}" data-nocache="true">立即砍价</span></a>{/if}

            {if $swi==1}<a class="nav-item lynn-bargain-a lynn-bargain-now-a"><span style="color: #ccc">尚未开始</span></a>{/if}
            {if $swi==2}<a href="" class="nav-item lynn-bargain-a lynn-bargain-now-a"><span style="color: #ccc">已经结束</span></a>{/if}
            {if $swi==3}<a href="" class="nav-item lynn-bargain-a lynn-bargain-now-a"><span style="color: #ccc">库存不足</span></a>{/if}
            <a href="{php echo mobileurl('bargain/act');}" class="nav-item home-btn">
                <span class="icon icon-my1"></span>
                <span class="label">我的</span>
            </a>
        </div>
</div>

    <script>

        function callback() {
            window.location.href = "{php echo mobileUrl('bargain/bargain',array('id'=>$act_swi['id']))}";
        }
    </script>



{template '_footer'}